package at.fhhgb.mc.android.mfb_hgb.activity;

import android.app.AlertDialog;
import android.app.Dialog;
import android.app.DialogFragment;
import android.content.DialogInterface;
import android.os.Bundle;
import android.widget.Toast;
import at.fhhgb.mc.android.mfb_hgb.R;

public class RequestDialogFragment extends DialogFragment {

	@Override
	public Dialog onCreateDialog(Bundle savedInstanceState) {
		// Use the Builder class for convenient dialog construction
		AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());

		builder.setMessage(R.string.req_title).setPositiveButton(R.string.req_ok, new DialogInterface.OnClickListener() {
			public void onClick(DialogInterface dialog, int id) {
				Toast.makeText(getActivity(), getResources().getString(R.string.req_string1) + getArguments().getString("name") + getResources().getString(R.string.req_string2), Toast.LENGTH_SHORT).show();
			}
		}).setNegativeButton(R.string.req_cancel, null);
		// Create the AlertDialog object and return it
		return builder.create();
	}
}
